<?php
namespace app\common\model;

use think\Model;

/**  YSF
 *   职工业绩表 模型
 *   Date: 2019/4/16
 * Class OaAchievementWorkersModel
 * @package app\common\model
 */
class OaAchievementWorkersModel extends Model
{
    // 表名
    protected $name = 'oa_achievement_workers';

    // 列表查询
    public function getAll($where=[],$field='*',$page=1,$pageSize=9999,$order='')
    {
        $result = $this->where($where)
                ->field($field)
                ->page($page, $pageSize)
                ->order($order)
                ->select();
        return $result;
    }

    // 单条查询
    public function getOne($where=[],$field='*',$join=[])
    {
        $result = $this->alias('a')->where($where)->join($join)
                    ->field($field)
                    ->find();
        return $result;
    }

    // 连表分组查询
    public function getJoinGroupAll($where=[],$field='*',$join=[],$group='',$page=1,$pageSize=9999999,$order='')
    {
        $result = $this->alias('a')
                    ->where($where)
                    ->join($join)
                    ->group($group)
                    ->field($field)
                    ->page($page, $pageSize)
                    ->order($order)
                    ->select();
        return $result;
    }








}